<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>



    <script>


        let num = 1;


        function fun() {
          num++;
          if (num>3)
              num=1;
          const img = document.getElementById("img");
          switch (num) {
              case (1):
                  img.src="img/a.jpg";
                  break;
              case (2):
                  img.src="img/b.jpg";
                  break;
              case (3):
                  img.src="img/c.jpg";
                  break;

          }


      }

        setInterval(fun,3000);











    </script>
</head>
<body>


   <img id="img" src="img/a.jpg" width="50%">

</body>
</html>